package crs.informes.model;
// Generated 12-mar-2015 18:17:55 by Hibernate Tools 3.4.0.CR1

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

import crs.perfiles.model.CrsPerfilMedico;
import crs.solicitudes.model.CrsSolicitudes;

/**
 * CrsInformes generated by hbm2java
 */
@Entity
@Table(name = "crs_informes", schema = "public", uniqueConstraints = @UniqueConstraint(columnNames = "solicitudid"))
public class CrsInformes implements java.io.Serializable {

	private long solicitudid;
	private CrsPerfilMedico crsPerfilMedico;
	private CrsSolicitudes crsSolicitudes;
	private Date fecharedaccion;
	private String rutafichero;
	private String inforg;
	private short estado;
	private String observaciones;
	private Date fechaultdescarga;
	private Short duracion;
	private short frcmedia;
	private short frcmaxesfuerzo;
	private Short frcmaxima;
	private Short frcreposo;
	private short frcminima;
	private short fcminima;
	private short fcmaxima;
	private short fcrecuperacion;
	private String interpretacion;
	private String recomendaciones;

	public CrsInformes() {
	}

	public CrsInformes(CrsPerfilMedico crsPerfilMedico,
			CrsSolicitudes crsSolicitudes, Date fecharedaccion,
			String rutafichero, short estado, Date fechaultdescarga,
			short frcmedia, short frcmaxesfuerzo, Short frcmaxima,
			Short frcreposo, short frcminima, short fcminima, short fcmaxima,
			short fcrecuperacion, String interpretacion) {
		this.crsPerfilMedico = crsPerfilMedico;
		this.crsSolicitudes = crsSolicitudes;
		this.fecharedaccion = fecharedaccion;
		this.rutafichero = rutafichero;
		this.estado = estado;
		this.fechaultdescarga = fechaultdescarga;
		this.frcmedia = frcmedia;
		this.frcmaxesfuerzo = frcmaxesfuerzo;
		this.frcmaxima = frcmaxima;
		this.frcreposo = frcreposo;
		this.frcminima = frcminima;
		this.fcminima = fcminima;
		this.fcmaxima = fcmaxima;
		this.fcrecuperacion = fcrecuperacion;
		this.interpretacion = interpretacion;
	}

	public CrsInformes(CrsPerfilMedico crsPerfilMedico,
			CrsSolicitudes crsSolicitudes, Date fecharedaccion,
			String rutafichero, String inforg, short estado,
			String observaciones, Date fechaultdescarga, short frcmedia,
			short frcmaxesfuerzo, Short frcmaxima, Short frcreposo,
			short frcminima, short fcminima, short fcmaxima,
			short fcrecuperacion, String interpretacion, String recomendaciones) {
		this.crsPerfilMedico = crsPerfilMedico;
		this.crsSolicitudes = crsSolicitudes;
		this.fecharedaccion = fecharedaccion;
		this.rutafichero = rutafichero;
		this.inforg = inforg;
		this.estado = estado;
		this.observaciones = observaciones;
		this.fechaultdescarga = fechaultdescarga;
		this.frcmedia = frcmedia;
		this.frcmaxesfuerzo = frcmaxesfuerzo;
		this.frcmaxima = frcmaxima;
		this.frcreposo = frcreposo;
		this.frcminima = frcminima;
		this.fcminima = fcminima;
		this.fcmaxima = fcmaxima;
		this.fcrecuperacion = fcrecuperacion;
		this.interpretacion = interpretacion;
		this.recomendaciones = recomendaciones;
	}

	@GenericGenerator(name = "generator", strategy = "foreign", parameters = @Parameter(name = "property", value = "crsSolicitudes"))
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "solicitudid", unique = true, nullable = false)
	public long getSolicitudid() {
		return this.solicitudid;
	}

	public void setSolicitudid(long solicitudid) {
		this.solicitudid = solicitudid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "medicoid", nullable = false)
	public CrsPerfilMedico getCrsPerfilMedico() {
		return this.crsPerfilMedico;
	}

	public void setCrsPerfilMedico(CrsPerfilMedico crsPerfilMedico) {
		this.crsPerfilMedico = crsPerfilMedico;
	}

	@OneToOne(fetch = FetchType.LAZY)
	@PrimaryKeyJoinColumn
	public CrsSolicitudes getCrsSolicitudes() {
		return this.crsSolicitudes;
	}

	public void setCrsSolicitudes(CrsSolicitudes crsSolicitudes) {
		this.crsSolicitudes = crsSolicitudes;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "fecharedaccion", nullable = false, length = 13)
	public Date getFecharedaccion() {
		return this.fecharedaccion;
	}

	public void setFecharedaccion(Date fecharedaccion) {
		this.fecharedaccion = fecharedaccion;
	}

	@Column(name = "rutafichero", nullable = false, length = 150)
	public String getRutafichero() {
		return this.rutafichero;
	}

	public void setRutafichero(String rutafichero) {
		this.rutafichero = rutafichero;
	}

	@Column(name = "inforg", length = 150)
	public String getInforg() {
		return this.inforg;
	}

	public void setInforg(String inforg) {
		this.inforg = inforg;
	}

	@Column(name = "estado", nullable = false)
	public short getEstado() {
		return this.estado;
	}

	public void setEstado(short estado) {
		this.estado = estado;
	}

	@Column(name = "observaciones", length = 500)
	public String getObservaciones() {
		return this.observaciones;
	}

	public void setObservaciones(String observaciones) {
		this.observaciones = observaciones;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "fechaultdescarga", nullable = false, length = 29)
	public Date getFechaultdescarga() {
		return this.fechaultdescarga;
	}

	public void setFechaultdescarga(Date fechaultdescarga) {
		this.fechaultdescarga = fechaultdescarga;
	}

	@Column(name = "frcmedia", nullable = false)
	public short getFrcmedia() {
		return this.frcmedia;
	}

	public void setFrcmedia(short frcmedia) {
		this.frcmedia = frcmedia;
	}

	@Column(name = "frcmaxesfuerzo", nullable = false)
	public short getFrcmaxesfuerzo() {
		return this.frcmaxesfuerzo;
	}

	public void setFrcmaxesfuerzo(short frcmaxesfuerzo) {
		this.frcmaxesfuerzo = frcmaxesfuerzo;
	}

	@Column(name = "frcmaxima", nullable = false)
	public Short getFrcmaxima() {
		return this.frcmaxima;
	}

	public void setFrcmaxima(Short frcmaxima) {
		this.frcmaxima = frcmaxima;
	}

	@Column(name = "frcreposo", nullable = false)
	public Short getFrcreposo() {
		return this.frcreposo;
	}

	public void setFrcreposo(Short frcreposo) {
		this.frcreposo = frcreposo;
	}

	@Column(name = "frcminima", nullable = false)
	public short getFrcminima() {
		return this.frcminima;
	}

	public void setFrcminima(short frcminima) {
		this.frcminima = frcminima;
	}

	@Column(name = "fcminima", nullable = false)
	public short getFcminima() {
		return this.fcminima;
	}

	public void setFcminima(short fcminima) {
		this.fcminima = fcminima;
	}

	@Column(name = "fcmaxima", nullable = false)
	public short getFcmaxima() {
		return this.fcmaxima;
	}

	public void setFcmaxima(short fcmaxima) {
		this.fcmaxima = fcmaxima;
	}

	@Column(name = "fcrecuperacion", nullable = false)
	public short getFcrecuperacion() {
		return this.fcrecuperacion;
	}

	public void setFcrecuperacion(short fcrecuperacion) {
		this.fcrecuperacion = fcrecuperacion;
	}

	@Column(name = "interpretacion", nullable = false, length = 800)
	public String getInterpretacion() {
		return this.interpretacion;
	}
	public String getInterpretacionConBr() {
		if (this.interpretacion!=null){
			return this.interpretacion.replaceAll("\r\n", "<br />");
		}else{
			return "";
		}
	}

	public void setInterpretacion(String interpretacion) {
		this.interpretacion = interpretacion;
	}

	@Column(name = "recomendaciones", length = 800)
	public String getRecomendaciones() {
		return this.recomendaciones;
	}
	
	public String getRecomendacionesConBr() {
		if (this.recomendaciones!=null){
			return this.recomendaciones.replaceAll("\r\n", "<br />");
		}else{
			return "";
		}
	}

	public void setRecomendaciones(String recomendaciones) {
		this.recomendaciones = recomendaciones;
	}
	@Column(name = "duracion", nullable = true, precision = 3, scale = 0)
	public Short getDuracion() {
		return duracion;
	}

	public void setDuracion(Short duracion) {
		this.duracion = duracion;
	}

}
